package com.ai.interceptor;

import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author hh
 * @since 2024/5/28
 */
@RestControllerAdvice
public class GlobalExceptionInterceptor {

    @ExceptionHandler(Exception.class)
    @ResponseStatus(HttpStatus.OK)
    public String handleException(Exception e){
        return e.getMessage();
    }

}
